<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>restclient-cpp: include/restclient-cpp/restclient.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">restclient-cpp
   </div>
   <div id="projectbrief">C++ client for making HTTP/REST requests</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_d7863d21b35bfd92001c24d3be435c80.html">restclient-cpp</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">restclient.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="restclient_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#ifndef INCLUDE_RESTCLIENT_CPP_RESTCLIENT_H_</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#define INCLUDE_RESTCLIENT_CPP_RESTCLIENT_H_</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;</div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#include &lt;curl/curl.h&gt;</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &lt;cstdlib&gt;</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &quot;restclient-cpp/version.h&quot;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_rest_client.html">RestClient</a> {</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div>
<div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="namespace_rest_client.html#ab2bbc7fd5ec10171e4e1fb2d7fc8e865">   27</a></span>&#160;<span class="keyword">typedef</span> std::map&lt;std::string, std::string&gt; <a class="code" href="namespace_rest_client.html#ab2bbc7fd5ec10171e4e1fb2d7fc8e865">HeaderFields</a>;</div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;</div>
<div class="line"><a name="l00038"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_response.html">   38</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_response.html#a3b3b63aeae7ca761d54a009ee329ea28">   39</a></span>&#160;  <span class="keywordtype">int</span> <a class="code" href="struct_rest_client_1_1_response.html#a3b3b63aeae7ca761d54a009ee329ea28">code</a>;</div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_response.html#a87ba6d5e5ae9ae7d628d5ed34b36cc95">   40</a></span>&#160;  std::string <a class="code" href="struct_rest_client_1_1_response.html#a87ba6d5e5ae9ae7d628d5ed34b36cc95">body</a>;</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="struct_rest_client_1_1_response.html#a2141b4d9929e0df26d918dfba8451496">   41</a></span>&#160;  HeaderFields <a class="code" href="struct_rest_client_1_1_response.html#a2141b4d9929e0df26d918dfba8451496">headers</a>;</div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;} <a class="code" href="struct_rest_client_1_1_response.html">Response</a>;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;</div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="comment">// init and disable functions</span></div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="keywordtype">int</span> <a class="code" href="namespace_rest_client.html#a38395626a68f2dc66e2acf5b01f5b70b">init</a>();</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespace_rest_client.html#aa4dc1337561e6622b013d22639d3d26c">disable</a>();</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<a class="code" href="struct_rest_client_1_1_response.html">Response</a> <span class="keyword">get</span>(<span class="keyword">const</span> std::string&amp; url);</div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<a class="code" href="struct_rest_client_1_1_response.html">Response</a> <a class="code" href="namespace_rest_client.html#a7de7aa2d333b6e7c5f2c2726d4e5485e">post</a>(<span class="keyword">const</span> std::string&amp; url,</div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;              <span class="keyword">const</span> std::string&amp; content_type,</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;              <span class="keyword">const</span> std::string&amp; data);</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<a class="code" href="struct_rest_client_1_1_response.html">Response</a> <a class="code" href="namespace_rest_client.html#ac180f6320d47cad592399378f8c45f7a">put</a>(<span class="keyword">const</span> std::string&amp; url,</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;              <span class="keyword">const</span> std::string&amp; content_type,</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;              <span class="keyword">const</span> std::string&amp; data);</div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;<a class="code" href="struct_rest_client_1_1_response.html">Response</a> <a class="code" href="namespace_rest_client.html#a52975c3a96fe5f90b40adc74faae8f94">del</a>(<span class="keyword">const</span> std::string&amp; url);</div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<a class="code" href="struct_rest_client_1_1_response.html">Response</a> <a class="code" href="namespace_rest_client.html#a99dee400dfdab150b9fdce2ab6a0c2dc">head</a>(<span class="keyword">const</span> std::string&amp; url);</div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;}  <span class="comment">// namespace RestClient</span></div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="preprocessor">#endif  // INCLUDE_RESTCLIENT_CPP_RESTCLIENT_H_</span></div>
<div class="ttc" id="struct_rest_client_1_1_response_html_a2141b4d9929e0df26d918dfba8451496"><div class="ttname"><a href="struct_rest_client_1_1_response.html#a2141b4d9929e0df26d918dfba8451496">RestClient::Response::headers</a></div><div class="ttdeci">HeaderFields headers</div><div class="ttdef"><b>Definition:</b> restclient.h:41</div></div>
<div class="ttc" id="struct_rest_client_1_1_response_html_a3b3b63aeae7ca761d54a009ee329ea28"><div class="ttname"><a href="struct_rest_client_1_1_response.html#a3b3b63aeae7ca761d54a009ee329ea28">RestClient::Response::code</a></div><div class="ttdeci">int code</div><div class="ttdef"><b>Definition:</b> restclient.h:39</div></div>
<div class="ttc" id="struct_rest_client_1_1_response_html"><div class="ttname"><a href="struct_rest_client_1_1_response.html">RestClient::Response</a></div><div class="ttdoc">This structure represents the HTTP response data. </div><div class="ttdef"><b>Definition:</b> restclient.h:38</div></div>
<div class="ttc" id="namespace_rest_client_html_ab2bbc7fd5ec10171e4e1fb2d7fc8e865"><div class="ttname"><a href="namespace_rest_client.html#ab2bbc7fd5ec10171e4e1fb2d7fc8e865">RestClient::HeaderFields</a></div><div class="ttdeci">std::map&lt; std::string, std::string &gt; HeaderFields</div><div class="ttdef"><b>Definition:</b> restclient.h:27</div></div>
<div class="ttc" id="namespace_rest_client_html_aa4dc1337561e6622b013d22639d3d26c"><div class="ttname"><a href="namespace_rest_client.html#aa4dc1337561e6622b013d22639d3d26c">RestClient::disable</a></div><div class="ttdeci">void disable()</div><div class="ttdoc">global disable function. Call this before you terminate your program. </div><div class="ttdef"><b>Definition:</b> restclient.cc:37</div></div>
<div class="ttc" id="namespace_rest_client_html_a99dee400dfdab150b9fdce2ab6a0c2dc"><div class="ttname"><a href="namespace_rest_client.html#a99dee400dfdab150b9fdce2ab6a0c2dc">RestClient::head</a></div><div class="ttdeci">Response head(const std::string &amp;url)</div><div class="ttdoc">HTTP HEAD method. </div><div class="ttdef"><b>Definition:</b> restclient.cc:118</div></div>
<div class="ttc" id="namespace_rest_client_html_a52975c3a96fe5f90b40adc74faae8f94"><div class="ttname"><a href="namespace_rest_client.html#a52975c3a96fe5f90b40adc74faae8f94">RestClient::del</a></div><div class="ttdeci">Response del(const std::string &amp;url)</div><div class="ttdoc">HTTP DELETE method. </div><div class="ttdef"><b>Definition:</b> restclient.cc:103</div></div>
<div class="ttc" id="namespace_rest_client_html_ac180f6320d47cad592399378f8c45f7a"><div class="ttname"><a href="namespace_rest_client.html#ac180f6320d47cad592399378f8c45f7a">RestClient::put</a></div><div class="ttdeci">Response put(const std::string &amp;url, const std::string &amp;content_type, const std::string &amp;data)</div><div class="ttdoc">HTTP PUT method. </div><div class="ttdef"><b>Definition:</b> restclient.cc:85</div></div>
<div class="ttc" id="namespace_rest_client_html_a7de7aa2d333b6e7c5f2c2726d4e5485e"><div class="ttname"><a href="namespace_rest_client.html#a7de7aa2d333b6e7c5f2c2726d4e5485e">RestClient::post</a></div><div class="ttdeci">Response post(const std::string &amp;url, const std::string &amp;content_type, const std::string &amp;data)</div><div class="ttdoc">HTTP POST method. </div><div class="ttdef"><b>Definition:</b> restclient.cc:65</div></div>
<div class="ttc" id="namespace_rest_client_html_a38395626a68f2dc66e2acf5b01f5b70b"><div class="ttname"><a href="namespace_rest_client.html#a38395626a68f2dc66e2acf5b01f5b70b">RestClient::init</a></div><div class="ttdeci">int init()</div><div class="ttdoc">global init function. Call this before you start any threads. </div><div class="ttdef"><b>Definition:</b> restclient.cc:24</div></div>
<div class="ttc" id="struct_rest_client_1_1_response_html_a87ba6d5e5ae9ae7d628d5ed34b36cc95"><div class="ttname"><a href="struct_rest_client_1_1_response.html#a87ba6d5e5ae9ae7d628d5ed34b36cc95">RestClient::Response::body</a></div><div class="ttdeci">std::string body</div><div class="ttdef"><b>Definition:</b> restclient.h:40</div></div>
<div class="ttc" id="namespace_rest_client_html"><div class="ttname"><a href="namespace_rest_client.html">RestClient</a></div><div class="ttdoc">namespace for all RestClient definitions </div><div class="ttdef"><b>Definition:</b> connection.h:23</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Dec 2 2016 10:53:09 for restclient-cpp by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
